programming4us
           
 
 
Sharepoint

Working with Search Page Layouts : Applying a Branded Master Page to a Search Center

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
8/19/2011 9:26:58 AM
Many corporations prefer to add branding to the front-end layout of their SharePoint farm. Usually this is done on the master pages. Specifically the v4.master is often the one that corporations change. This is all fine for normal sites, but in many cases special attention needs to be paid to the search center, as the v4-based master pages break the search center.

1. Search Box Is Hiding When Branding a Search Center

Figure 1 shows the standard search page in a search center. Pay attention to the search box, as this is the root of the problem.

Figure 1. Standard search center search page

Normally a site collection is created with a search center underneath. Alternatively this is done by creating a publishing portal that already has a search center created. The next step is usually to apply the corporate custom branded master page to all subsites. For a fictive corporation, it could look something like Figure 2.

Figure 2. Corporate custom branded master page screen dump from search center search page

Now the search page has the custom branded layout, but the search box has disappeared. This is because the search center doesn't support the v4 master pages. The search box is not gone; it is actually hidden in the breadcrumb placeholder.

This works just fine when minimal.master is applied, but as mentioned, the layout problem, shown in Figure 3, happens when trying to apply any of the other out-of-the-box v4 master pages or a custom branded master page simply by clicking the "apply to all subsites" box.

Figure 3. Browse button clicked to show the search box located in the breadcrumb placeholder

2. Making Navigation Visible and Showing the Search Box Correctly

This can obviously be fixed by creating a new custom branded master page based on the minimal.master or by adjusting the page layouts in the search center to use the standard content placeholders. In this case, it is recommended, however, to create a new custom branded master page based on the current custom branded master page. With minor adjustments, it can be modified to work with search centers. This approach makes it easier to maintain the master pages in the future.

In Listing 1, a copy of the v4.master is modified to work with search centers. This is also useful if the purpose is just to add normal navigation to the default SharePoint 2010 Search Center. Basic knowledge about master pages and SharePoint Designer 2010 is assumed.

Make a copy of v4.master, and give it a new name like v4_searchcenter.master. Then edit the new master page. Then find and remove the tag named PlaceHolderTitleBreadcrumb. Now the breadcrumb will work as expected without it being located in the drop-down placeholder.

Example 1. Removing ContentPlaceHolder Wrapping of the Breadcrumb
<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb" runat="server">
<SharePoint:ListSiteMapPath
runat="server"
SiteMapProviders="SPSiteMapProvider,SPContentMapProvider"
RenderCurrentNodeAsLink="false"
PathSeparator=""
CssClass="s4-breadcrumb"
NodeStyle-CssClass="s4-breadcrumbNode"

CurrentNodeStyle-CssClass="s4-breadcrumbCurrentNode"
RootNodeStyle-CssClass="s4-breadcrumbRootNode"
NodeImageOffsetX=0
NodeImageOffsetY=353
NodeImageWidth=16
NodeImageHeight=16
NodeImageUrl="/_layouts/images/fgimg.png"
RTLNodeImageOffsetX=0
RTLNodeImageOffsetY=376
RTLNodeImageWidth=16
RTLNodeImageHeight=16
RTLNodeImageUrl="/_layouts/images/fgimg.png"
HideInteriorRootNodes="true"
SkipLinkText="" />
</asp:ContentPlaceHolder>

Next, add the PlaceHolderTitleBreadcrumb before the PlaceHolderMain. This will allow the search center to inject the search box in a good location:

<asp:ContentPlaceHolder id="PlaceHolderTitleBreadcrumb"

runat="server"></asp:ContentPlaceHolder>
<asp:ContentPlaceHolder id="PlaceHolderMain" runat="server"/>

Move PlaceHolderPageTitleInTitleArea (and any supporting HTML) to a hidden panel because this placeholder isn't used the same way in the search center:

<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
<asp:Panel visible="false" runat="server">
<asp:ContentPlaceHolder id="PlaceHolderPageTitleInTitleArea" runat="server" />
</asp:Panel>


Remove ClusteredDirectionalSeparatorArrow and <h2></h2>. It won't make sense to show these at the top now:

<SharePoint:ClusteredDirectionalSeparatorArrow runat="server"/>
<h2></h2>

3. Adding CSS Styling

To make the master page look correct for search centers, some CSS needs to be added. The CSS styles in Listing 2 are added to the <head> section of the master page.

Example 2. CSS styling of navigation
<style type="text/css">
.s4-ca {
margin-left: 0px;
}


.srch-sb-results {
background:transparent none repeat scroll 0 0;
}
.srch-sb-main {
padding-top: 20px;
}
.srch-sb-results4 {
margin: inherit;
padding-left: 20px;
}
.ms-bodyareaframe {
background-color: transparent;
}
td.ms-titleareaframe, div.ms-titleareaframe, .ms-pagetitleareaframe {
height: auto !important;
}
.ms-main .ms-ptabrx, .ms-main .ms-sctabrx, .ms-main .ms-ptabcn, .ms-main .ms-sctabcn {
border-color: #eeeeee;
}
.srch-sb-results {
height: auto;
}
.ms-sblink {
display:block;
}
.ms-sblink a:link, .ms-sblink a:visited, .ms-sblink a:hover {
color:#0072BC;
}
</style>


Finally, save and publish the new master page. It should be set only for search centers. The result will be that the search dialog now shows correctly as seen in Figure 4.

Figure 4. Branded master page

After these changes, the search center now reflects the custom branded master page in a still easy-to-maintain version. This techniques can also be used to create master pages with search center–specific branding.

Other -----------------
- SharePoint 2010 : Excel Services - User-Defined Functions
- SharePoint 2010 : Using the Excel Services REST API
- SharePoint 2010 : Social Sites: Providing a Structure for Collaborative Conversations
- SharePoint 2010 : Social Data: Enhancing Value with User Contributed Content
- Sharepoint 2010 : Excel Service - Demonstration Scenario (part 3)
- Sharepoint 2010 : Excel Service - Demonstration Scenario (part 2)
- Sharepoint 2010 : Excel Service - Demonstration Scenario (part 1)
- Working with Search Page Layouts : Adding Navigation to the Search Center (part 2)
- Working with Search Page Layouts : Adding Navigation to the Search Center (part 1) - Adding Home and Back Buttons to the Search Result Page
- Working with Search Page Layouts : Understanding Master Pages in SharePoint 2010
- Sharepoint 2010 : Social Networking - Engaging People
- Sharepoint 2010 : Developing a Strategy for SharePoint Community Features
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 3) - Installing and Configuring SQL Server Reporting Services 2008
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 2) - Understanding the Architecture of SQL Server Reporting Services 2008
- SharePoint 2010 : SQL Server Reporting Services 2008 (part 1)
- SharePoint 2010 : Configuring Excel Services
- Excel Capabilities on SharePoint 2010
- Setting Up UAG for SharePoint (part 2) - Publishing SharePoint Through a Portal Trunk in UAG
- Setting Up UAG for SharePoint (part 1) - Setting Up SharePoint for Cross-Firewall Access & Creating Application Portal Trunk in UAG
- Publishing SharePoint 2010 to Mobile Devices : Examining Common Firewall Configurations
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us